]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
bluetooth: When the placeholder is shown, announce it when reaching the toggle
authorLukáš Tyrychtr <ltyrycht@redhat.com>
Tue, 24 Sep 2024 11:44:15 +0000 (13:44 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 16 Oct 2024 16:47:09 +0000 (16:47 +0000)
Previously, the menu would be just empty, without any indication why.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3485>

js/ui/status/bluetooth.js

index c1d6837a8bcbd398fdea04db59c94fbfc00a0efa..794c08cbe89fddaf6fdc05c8788832cdd7edeace 100644 (file)
@@ -1,5 +1,6 @@
 import 'gi://GnomeBluetooth?version=3.0';
 
+import Atk from 'gi://Atk';
 import Gio from 'gi://Gio';
 import GLib from 'gi://GLib';
 import GnomeBluetooth from 'gi://GnomeBluetooth';
@@ -346,9 +347,19 @@ class BluetoothToggle extends QuickMenuToggle {
             : _('Turn on Bluetooth to connect to devices');
     }
 
+    _updatePlaceholderRelation() {
+        const accel = this.get_accessible();
+        const placeholderAccel = this._placeholderItem.get_accessible();
+        if (this._deviceSection.actor.visible)
+            accel.remove_relationship(Atk.RelationType.DESCRIBED_BY, placeholderAccel);
+        else
+            accel.add_relationship(Atk.RelationType.DESCRIBED_BY, placeholderAccel);
+    }
+
     _updateDeviceVisibility() {
         this._deviceSection.actor.visible =
             [...this._deviceItems.values()].some(item => item.visible);
+        this._updatePlaceholderRelation();
     }
 
     _getSortedDevices() {